home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / Luminance.h < prev    next >
MacBinary  |  1994-10-17  |  12.0 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Oct 17 15:09:53 1994, modified Mon Oct 17 15:09:53 1994, creator 'MMCC', type ASCII, 11531 bytes "Luminance.h" , at 0x2d8b 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 4c 75 6d 69 6e 61 | 6e 63 65 2e 68 00 00 00 |..Lumina|nce.h...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 2d 0b 00 | 00 01 ac aa c8 7c 81 aa |.....-..|.....|..|
|00000060| c8 7c 81 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.|......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 28 a5 00 00 |........|....(...|
|00000080| 2f 2a 0d 4c 75 6d 69 6e | 61 6e 63 65 2e 68 0d 54 |/*.Lumin|ance.h.T|
|00000090| 68 69 73 20 69 73 20 74 | 68 65 20 69 6e 63 6c 75 |his is t|he inclu|
|000000a0| 64 65 20 66 69 6c 65 20 | 66 6f 72 20 4c 75 6d 69 |de file |for Lumi|
|000000b0| 6e 61 6e 63 65 2e 63 20 | 61 6e 64 20 52 65 61 64 |nance.c |and Read|
|000000c0| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 2e |Luminanc|eRecord.|
|000000d0| 63 0d 43 6f 70 79 72 69 | 67 68 74 20 31 39 38 39 |c.Copyri|ght 1989|
|000000e0| 2c 31 39 39 30 2c 31 39 | 39 31 2c 31 39 39 32 20 |,1990,19|91,1992 |
|000000f0| 28 63 29 20 44 65 6e 69 | 73 20 47 2e 20 50 65 6c |(c) Deni|s G. Pel|
|00000100| 6c 69 20 0d 48 49 53 54 | 4f 52 59 3a 0d 39 2f 31 |li .HIST|ORY:.9/1|
|00000110| 38 2f 39 30 09 64 67 70 | 09 43 68 61 6e 67 65 64 |8/90.dgp|.Changed|
|00000120| 20 61 6c 6c 20 69 6e 73 | 74 61 6e 63 65 73 20 6f | all ins|tances o|
|00000130| 66 20 22 76 22 20 74 6f | 20 22 56 22 2e 20 54 68 |f "v" to| "V". Th|
|00000140| 65 20 66 69 6e 61 6c 20 | 76 65 72 73 69 6f 6e 20 |e final |version |
|00000150| 6f 66 20 74 68 65 20 50 | 65 6c 6c 69 0d 09 09 09 |of the P|elli....|
|00000160| 26 20 5a 68 61 6e 67 20 | 28 31 39 39 31 29 20 6d |& Zhang |(1991) m|
|00000170| 61 6e 75 73 63 72 69 70 | 74 20 72 65 66 65 72 73 |anuscrip|t refers|
|00000180| 20 74 6f 20 61 20 6e 6f | 6d 69 6e 61 6c 20 76 6f | to a no|minal vo|
|00000190| 6c 74 61 67 65 20 76 3b | 20 74 68 69 73 20 66 69 |ltage v;| this fi|
|000001a0| 6c 65 0d 09 09 09 6e 6f | 77 20 72 65 66 65 72 73 |le....no|w refers|
|000001b0| 20 74 6f 20 74 68 65 20 | 22 65 71 75 69 76 61 6c | to the |"equival|
|000001c0| 65 6e 74 20 6e 75 6d 62 | 65 72 22 20 56 3b 20 74 |ent numb|er" V; t|
|000001d0| 68 65 79 20 61 72 65 20 | 72 65 6c 61 74 65 64 20 |hey are |related |
|000001e0| 62 79 20 56 3d 32 35 35 | 2a 76 2e 0d 09 09 09 54 |by V=255|*v.....T|
|000001f0| 6f 20 61 76 6f 69 64 20 | 22 62 72 65 61 6b 69 6e |o avoid |"breakin|
|00000200| 67 22 20 61 6c 6c 20 74 | 68 65 20 6f 6c 64 20 4c |g" all t|he old L|
|00000210| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 2e 68 |uminance|Record.h|
|00000220| 20 66 69 6c 65 73 2c 20 | 49 27 76 65 20 0d 09 09 | files, |I've ...|
|00000230| 09 69 6e 74 72 6f 64 75 | 63 65 64 20 61 20 23 64 |.introdu|ced a #d|
|00000240| 65 66 69 6e 65 20 74 68 | 61 74 20 63 6f 6e 76 65 |efine th|at conve|
|00000250| 72 74 73 20 76 4d 69 6e | 20 26 20 76 4d 61 78 20 |rts vMin| & vMax |
|00000260| 74 6f 20 56 4d 69 6e 20 | 26 20 56 4d 61 78 2e 20 |to VMin |& VMax. |
|00000270| 48 6f 77 65 76 65 72 2c | 0d 09 09 09 74 68 69 73 |However,|....this|
|00000280| 20 69 73 20 61 20 74 65 | 6d 70 6f 72 61 72 79 20 | is a te|mporary |
|00000290| 66 69 78 2e 20 49 27 6c | 6c 20 70 72 6f 62 61 62 |fix. I'l|l probab|
|000002a0| 6c 79 20 72 65 6d 6f 76 | 65 20 74 68 65 20 64 65 |ly remov|e the de|
|000002b0| 66 69 6e 65 20 69 6e 20 | 61 20 66 65 77 20 6d 6f |fine in |a few mo|
|000002c0| 6e 74 68 73 2c 0d 09 09 | 09 73 6f 20 79 6f 75 20 |nths,...|.so you |
|000002d0| 73 68 6f 75 6c 64 20 73 | 74 69 6c 6c 20 75 70 64 |should s|till upd|
|000002e0| 61 74 65 20 61 6e 79 20 | 6f 6c 64 20 63 61 6c 69 |ate any |old cali|
|000002f0| 62 72 61 74 69 6f 6e 20 | 66 69 6c 65 73 2c 20 65 |bration |files, e|
|00000300| 69 74 68 65 72 20 62 79 | 20 65 64 69 74 69 6e 67 |ither by| editing|
|00000310| 2c 0d 09 09 09 72 65 70 | 6c 61 63 69 6e 67 20 22 |,....rep|lacing "|
|00000320| 76 4d 22 20 62 79 20 22 | 56 4d 22 20 6f 72 20 62 |vM" by "|VM" or b|
|00000330| 79 20 72 65 64 6f 69 6e | 67 20 74 68 65 20 63 61 |y redoin|g the ca|
|00000340| 6c 69 62 72 61 74 69 6f | 6e 2e 0d 39 2f 32 34 2f |libratio|n..9/24/|
|00000350| 39 30 09 64 67 70 09 41 | 64 64 65 64 20 73 63 72 |90.dgp.A|dded scr|
|00000360| 65 65 6e 20 26 20 64 61 | 74 65 2e 20 52 65 6e 61 |een & da|te. Rena|
|00000370| 6d 65 64 20 6e 42 61 63 | 6b 67 72 6f 75 6e 64 20 |med nBac|kground |
|00000380| 74 6f 20 56 42 61 63 6b | 67 72 6f 75 6e 64 2e 0d |to VBack|ground..|
|00000390| 09 09 09 52 65 6e 61 6d | 65 64 20 69 6e 64 65 78 |...Renam|ed index|
|000003a0| 20 74 6f 20 6c 61 73 74 | 49 6e 64 65 78 2e 0d 39 | to last|Index..9|
|000003b0| 2f 32 38 2f 39 30 09 64 | 67 70 09 52 65 6e 61 6d |/28/90.d|gp.Renam|
|000003c0| 65 64 20 6c 61 73 74 49 | 6e 64 65 78 20 74 6f 20 |ed lastI|ndex to |
|000003d0| 6c 61 74 65 73 74 49 6e | 64 65 78 2e 20 53 70 72 |latestIn|dex. Spr|
|000003e0| 75 63 65 64 20 75 70 20 | 73 6f 6d 65 20 6f 66 20 |uced up |some of |
|000003f0| 74 68 65 20 63 6f 6d 6d | 65 6e 74 73 2e 0d 31 30 |the comm|ents..10|
|00000400| 2f 33 31 2f 39 30 20 64 | 67 70 20 41 64 64 65 64 |/31/90 d|gp Added|
|00000410| 20 74 68 65 20 63 6f 6e | 64 69 74 69 6f 6e 61 6c | the con|ditional|
|00000420| 20 46 41 53 54 5f 4c 55 | 4d 49 4e 41 4e 43 45 2e | FAST_LU|MINANCE.|
|00000430| 20 53 65 74 74 69 6e 67 | 20 69 74 20 74 6f 20 31 | Setting| it to 1|
|00000440| 20 28 74 72 75 65 29 20 | 6d 61 6b 65 73 0d 09 09 | (true) |makes...|
|00000450| 09 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 41 6e |.SetLumi|nancesAn|
|00000460| 64 52 61 6e 67 65 28 29 | 20 72 75 6e 20 74 77 69 |dRange()| run twi|
|00000470| 63 65 20 61 73 20 66 61 | 73 74 2c 20 62 79 20 75 |ce as fa|st, by u|
|00000480| 73 69 6e 67 20 66 69 78 | 65 64 20 70 6f 69 6e 74 |sing fix|ed point|
|00000490| 0d 09 09 09 61 72 69 74 | 68 6d 65 74 69 63 20 69 |....arit|hmetic i|
|000004a0| 6e 73 74 65 61 64 20 6f | 66 20 64 6f 75 62 6c 65 |nstead o|f double|
|000004b0| 73 2e 20 53 65 74 74 69 | 6e 67 20 69 74 20 74 6f |s. Setti|ng it to|
|000004c0| 20 30 20 28 66 61 6c 73 | 65 29 20 63 61 75 73 65 | 0 (fals|e) cause|
|000004d0| 73 20 74 68 65 0d 09 09 | 09 73 61 6d 65 20 63 6f |s the...|.same co|
|000004e0| 64 65 20 74 6f 20 62 65 | 20 63 6f 6d 70 69 6c 65 |de to be| compile|
|000004f0| 64 20 74 6f 20 75 73 65 | 20 64 6f 75 62 6c 65 73 |d to use| doubles|
|00000500| 2e 20 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 |. Note t|hat the |
|00000510| 70 72 6f 74 6f 74 79 70 | 65 73 20 6f 66 0d 09 09 |prototyp|es of...|
|00000520| 09 73 6f 6d 65 20 69 6e | 74 65 72 6e 61 6c 20 66 |.some in|ternal f|
|00000530| 75 6e 63 74 69 6f 6e 73 | 20 28 6e 61 6d 65 73 20 |unctions| (names |
|00000540| 62 65 67 69 6e 6e 69 6e | 67 20 77 69 74 68 20 75 |beginnin|g with u|
|00000550| 6e 64 65 72 73 63 6f 72 | 65 29 20 61 72 65 20 63 |nderscor|e) are c|
|00000560| 6f 6e 64 69 74 69 6f 6e | 61 6c 0d 09 09 09 6f 6e |ondition|al....on|
|00000570| 20 46 41 53 54 5f 4c 55 | 4d 49 4e 41 4e 43 45 2e | FAST_LU|MINANCE.|
|00000580| 0d 31 31 2f 36 2f 39 30 | 20 64 67 70 20 52 65 70 |.11/6/90| dgp Rep|
|00000590| 6c 61 63 65 64 20 4d 69 | 6c 6c 69 20 62 79 20 46 |laced Mi|lli by F|
|000005a0| 69 78 65 64 2e 20 0d 31 | 31 2f 38 2f 39 30 20 64 |ixed. .1|1/8/90 d|
|000005b0| 67 70 09 45 6c 69 6d 69 | 6e 61 74 65 64 20 67 61 |gp.Elimi|nated ga|
|000005c0| 6d 6d 61 20 73 6c 6f 70 | 65 20 74 61 62 6c 65 20 |mma slop|e table |
|000005d0| 73 68 69 66 74 65 64 4c | 53 6c 6f 70 65 5b 5d 20 |shiftedL|Slope[] |
|000005e0| 73 69 6e 63 65 20 74 68 | 65 20 73 70 65 65 64 2d |since th|e speed-|
|000005f0| 75 70 20 69 74 20 6f 66 | 66 65 72 65 64 0d 09 09 |up it of|fered...|
|00000600| 09 77 61 73 20 74 6f 6f | 20 73 6d 61 6c 6c 20 74 |.was too| small t|
|00000610| 6f 20 6d 65 61 73 75 72 | 65 2e 0d 37 2f 33 30 2f |o measur|e..7/30/|
|00000620| 39 31 09 64 67 70 09 41 | 64 64 65 64 20 70 72 6f |91.dgp.A|dded pro|
|00000630| 74 6f 74 79 70 65 20 66 | 6f 72 20 52 65 61 64 4c |totype f|or ReadL|
|00000640| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 28 29 |uminance|Record()|
|00000650| 2e 0d 38 2f 34 2f 39 31 | 09 64 67 70 09 43 68 61 |..8/4/91|.dgp.Cha|
|00000660| 6e 67 65 20 52 65 61 64 | 4c 75 6d 69 6e 61 6e 63 |nge Read|Luminanc|
|00000670| 65 52 65 63 6f 72 64 28 | 29 20 74 6f 20 72 65 74 |eRecord(|) to ret|
|00000680| 75 72 6e 20 74 79 70 65 | 20 69 6e 74 2e 0d 38 2f |urn type| int..8/|
|00000690| 35 2f 39 31 09 64 67 70 | 09 54 72 79 69 6e 67 20 |5/91.dgp|.Trying |
|000006a0| 74 6f 20 63 6f 6d 70 69 | 6c 65 20 75 6e 64 65 72 |to compi|le under|
|000006b0| 20 4d 50 57 20 43 20 33 | 2e 32 20 75 6e 63 6f 76 | MPW C 3|.2 uncov|
|000006c0| 65 72 65 64 20 61 20 6e | 61 6d 65 2d 73 70 61 63 |ered a n|ame-spac|
|000006d0| 65 20 63 6f 6e 66 6c 69 | 63 74 2e 0d 09 09 09 54 |e confli|ct.....T|
|000006e0| 68 65 20 4d 50 57 20 43 | 20 33 2e 32 20 43 54 79 |he MPW C| 3.2 CTy|
|000006f0| 70 65 2e 68 20 68 65 61 | 64 65 72 20 66 69 6c 65 |pe.h hea|der file|
|00000700| 20 64 65 66 69 6e 65 73 | 20 5f 4c 20 61 73 20 61 | defines| _L as a|
|00000710| 20 70 72 65 70 72 6f 63 | 65 73 73 6f 72 20 63 6f | preproc|essor co|
|00000720| 6e 73 74 61 6e 74 2c 0d | 09 09 09 77 68 65 72 65 |nstant,.|...where|
|00000730| 61 73 20 4c 75 6d 69 6e | 61 6e 63 65 2e 68 20 75 |as Lumin|ance.h u|
|00000740| 73 65 73 20 69 74 20 61 | 73 20 61 20 66 69 65 6c |ses it a|s a fiel|
|00000750| 64 20 6f 66 20 74 68 65 | 20 6c 75 6d 69 6e 61 6e |d of the| luminan|
|00000760| 63 65 54 61 62 6c 65 20 | 73 74 72 75 63 74 75 72 |ceTable |structur|
|00000770| 65 2c 0d 09 09 09 61 6e | 64 20 61 73 20 61 20 70 |e,....an|d as a p|
|00000780| 61 72 61 6d 65 74 65 72 | 20 6e 61 6d 65 2e 0d 09 |arameter| name...|
|00000790| 09 09 54 68 65 20 54 48 | 49 4e 4b 20 43 20 34 2e |..The TH|INK C 4.|
|000007a0| 30 35 20 63 74 79 70 65 | 2e 68 20 68 65 61 64 65 |05 ctype|.h heade|
|000007b0| 72 20 66 69 6c 65 20 6e | 61 6d 65 73 20 74 68 65 |r file n|ames the|
|000007c0| 20 73 61 6d 65 20 63 6f | 6e 73 74 61 6e 74 20 5f | same co|nstant _|
|000007d0| 5f 4c 4f 57 52 2c 0d 09 | 09 09 77 68 69 63 68 20 |_LOWR,..|..which |
|000007e0| 6f 66 20 63 6f 75 72 73 | 65 20 64 6f 65 73 6e 27 |of cours|e doesn'|
|000007f0| 74 20 63 6f 6e 66 6c 69 | 63 74 2e 20 54 68 65 20 |t confli|ct. The |
|00000800| 6f 62 76 69 6f 75 73 20 | 73 6f 6c 75 74 69 6f 6e |obvious |solution|
|00000810| 20 77 6f 75 6c 64 20 62 | 65 20 74 6f 0d 09 09 09 | would b|e to....|
|00000820| 63 68 61 6e 67 65 20 4d | 50 57 27 73 20 43 54 79 |change M|PW's CTy|
|00000830| 70 65 2e 68 20 5f 4c 20 | 74 6f 20 5f 4c 4f 57 52 |pe.h _L |to _LOWR|
|00000840| 2c 20 62 75 74 20 74 68 | 61 74 20 77 6f 75 6c 64 |, but th|at would|
|00000850| 20 63 6f 6d 70 72 6f 6d | 69 73 65 20 70 6f 72 74 | comprom|ise port|
|00000860| 61 62 69 6c 69 74 79 2e | 0d 09 09 09 49 20 64 65 |ability.|....I de|
|00000870| 63 69 64 65 64 20 6e 6f | 74 20 74 6f 20 63 68 61 |cided no|t to cha|
|00000880| 6e 67 65 20 5f 4c 20 69 | 6e 20 4c 75 6d 69 6e 61 |nge _L i|n Lumina|
|00000890| 6e 63 65 2e 68 20 61 6e | 64 20 4c 75 6d 69 6e 61 |nce.h an|d Lumina|
|000008a0| 6e 63 65 2e 63 2c 0d 09 | 09 09 62 65 63 61 75 73 |nce.c,..|..becaus|
|000008b0| 65 20 69 74 20 77 6f 75 | 6c 64 20 62 65 20 68 61 |e it wou|ld be ha|
|000008c0| 72 64 20 74 6f 20 64 6f | 20 74 68 61 74 20 69 6e |rd to do| that in|
|000008d0| 20 61 20 77 61 79 20 74 | 68 61 74 20 77 6f 75 6c | a way t|hat woul|
|000008e0| 64 6e 27 74 20 63 6f 6d | 70 72 6f 6d 69 73 65 20 |dn't com|promise |
|000008f0| 0d 09 09 09 74 68 65 20 | 72 65 61 64 61 62 69 6c |....the |readabil|
|00000900| 69 74 79 20 6f 66 20 74 | 68 65 20 63 6f 64 65 2e |ity of t|he code.|
|00000910| 20 48 6f 77 65 76 65 72 | 2c 20 49 20 64 69 64 20 | However|, I did |
|00000920| 64 6f 20 61 20 71 75 69 | 63 6b 20 68 61 63 6b 2c |do a qui|ck hack,|
|00000930| 20 0d 09 09 09 61 62 6f | 75 74 20 74 65 6e 20 6c | ....abo|ut ten l|
|00000940| 69 6e 65 73 20 62 65 6c | 6f 77 2c 20 74 68 61 74 |ines bel|ow, that|
|00000950| 20 72 65 64 65 66 69 6e | 65 73 20 5f 4c 20 61 73 | redefin|es _L as|
|00000960| 20 61 6e 20 65 6e 75 6d | 2c 20 77 68 69 63 68 20 | an enum|, which |
|00000970| 73 6f 6c 76 65 73 20 74 | 68 65 0d 09 09 09 70 72 |solves t|he....pr|
|00000980| 6f 62 6c 65 6d 2c 20 70 | 72 6f 76 69 64 65 64 20 |oblem, p|rovided |
|00000990| 43 54 79 70 65 2e 68 20 | 69 73 20 69 6e 63 6c 75 |CType.h |is inclu|
|000009a0| 64 65 64 20 62 65 66 6f | 72 65 20 4c 75 6d 69 6e |ded befo|re Lumin|
|000009b0| 61 6e 63 65 2e 68 20 69 | 6e 20 66 69 6c 65 73 20 |ance.h i|n files |
|000009c0| 74 68 61 74 0d 09 09 09 | 6e 65 65 64 20 74 6f 20 |that....|need to |
|000009d0| 65 78 70 6c 69 63 69 74 | 6c 79 20 61 63 63 65 73 |explicit|ly acces|
|000009e0| 73 20 5f 4c 2e 20 49 6e | 20 66 61 63 74 20 5f 4c |s _L. In| fact _L|
|000009f0| 20 69 73 20 69 6e 74 65 | 6e 64 65 64 20 66 6f 72 | is inte|nded for|
|00000a00| 20 75 73 65 0d 09 09 09 | 6f 6e 6c 79 20 62 79 20 | use....|only by |
|00000a10| 74 68 65 20 72 6f 75 74 | 69 6e 65 73 20 74 68 61 |the rout|ines tha|
|00000a20| 74 20 61 72 65 20 69 6e | 20 4c 75 6d 69 6e 61 6e |t are in| Luminan|
|00000a30| 63 65 2e 63 2c 20 73 6f | 20 49 20 73 75 73 70 65 |ce.c, so| I suspe|
|00000a40| 63 74 20 74 68 65 0d 09 | 09 09 70 72 6f 62 6c 65 |ct the..|..proble|
|00000a50| 6d 20 69 73 20 73 6f 6c | 76 65 64 2e 0d 31 32 2f |m is sol|ved..12/|
|00000a60| 31 37 2f 39 32 09 64 67 | 70 20 52 65 6d 6f 76 65 |17/92.dg|p Remove|
|00000a70| 64 20 6f 62 73 6f 6c 65 | 74 65 20 73 75 70 70 6f |d obsole|te suppo|
|00000a80| 72 74 20 66 6f 72 20 54 | 48 49 4e 4b 20 43 20 34 |rt for T|HINK C 4|
|00000a90| 2e 20 0d 31 32 2f 32 31 | 2f 39 32 20 64 67 70 20 |. .12/21|/92 dgp |
|00000aa0| 41 64 64 65 64 20 64 61 | 63 53 69 7a 65 20 61 6e |Added da|cSize an|
|00000ab0| 64 20 6c 65 66 74 53 68 | 69 66 74 2e 0d 36 2f 35 |d leftSh|ift..6/5|
|00000ac0| 2f 39 33 09 64 67 70 09 | 52 65 6d 6f 76 65 64 20 |/93.dgp.|Removed |
|00000ad0| 74 68 65 20 61 6e 63 69 | 65 6e 74 20 23 64 65 66 |the anci|ent #def|
|00000ae0| 69 6e 65 73 20 74 68 61 | 74 20 77 65 72 65 20 72 |ines tha|t were r|
|00000af0| 65 71 75 69 72 65 64 20 | 74 6f 20 72 65 61 64 20 |equired |to read |
|00000b00| b2 31 39 39 30 20 63 61 | 6c 69 62 72 61 74 69 6f |.1990 ca|libratio|
|00000b10| 6e 0d 09 09 09 66 69 6c | 65 73 2e 0d 38 2f 31 32 |n....fil|es..8/12|
|00000b20| 2f 39 33 09 64 67 70 09 | 75 70 64 61 74 65 64 20 |/93.dgp.|updated |
|00000b30| 52 65 61 64 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ReadLumi|nanceRec|
|00000b40| 6f 72 64 28 29 20 70 72 | 6f 74 6f 74 79 70 65 20 |ord() pr|ototype |
|00000b50| 74 6f 20 6d 61 74 63 68 | 20 73 6f 75 72 63 65 20 |to match| source |
|00000b60| 66 69 6c 65 2e 0d 38 2f | 31 2f 39 34 09 64 67 70 |file..8/|1/94.dgp|
|00000b70| 20 52 65 6e 61 6d 65 64 | 20 22 5f 4c 22 20 74 6f | Renamed| "_L" to|
|00000b80| 20 22 5f 4c 75 22 20 74 | 6f 20 61 76 6f 69 64 20 | "_Lu" t|o avoid |
|00000b90| 63 6f 6e 66 6c 69 63 74 | 20 77 69 74 68 20 5f 4c |conflict| with _L|
|00000ba0| 28 29 20 6d 61 63 72 6f | 20 64 65 66 69 6e 65 64 |() macro| defined|
|00000bb0| 20 69 6e 20 66 70 2e 68 | 2e 0d 31 30 2f 31 37 2f | in fp.h|..10/17/|
|00000bc0| 39 34 20 64 67 70 20 63 | 61 70 69 74 61 6c 69 7a |94 dgp c|apitaliz|
|00000bd0| 65 64 20 6c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ed lumin|anceReco|
|00000be0| 72 64 20 74 6f 20 4c 75 | 6d 69 6e 61 6e 63 65 52 |rd to Lu|minanceR|
|00000bf0| 65 63 6f 72 64 2c 20 62 | 75 74 20 72 65 74 61 69 |ecord, b|ut retai|
|00000c00| 6e 65 64 20 61 20 74 79 | 70 65 64 65 66 0d 09 09 |ned a ty|pedef...|
|00000c10| 09 6f 66 20 6f 6c 64 20 | 66 6f 72 20 62 61 63 6b |.of old |for back|
|00000c20| 77 61 72 64 20 63 6f 6d | 70 61 74 69 62 69 6c 69 |ward com|patibili|
|00000c30| 74 79 2e 0d 2a 2f 0d 0d | 23 70 72 61 67 6d 61 20 |ty..*/..|#pragma |
|00000c40| 6f 6e 63 65 09 09 2f 2a | 20 73 75 70 70 72 65 73 |once../*| suppres|
|00000c50| 73 20 6d 75 6c 74 69 70 | 6c 65 20 69 6e 63 6c 75 |s multip|le inclu|
|00000c60| 73 69 6f 6e 73 20 6f 66 | 20 74 68 69 73 20 66 69 |sions of| this fi|
|00000c70| 6c 65 20 2a 2f 0d 23 69 | 66 6e 64 65 66 20 5f 4c |le */.#i|fndef _L|
|00000c80| 55 4d 49 4e 41 4e 43 45 | 5f 09 2f 2a 20 73 75 70 |UMINANCE|_./* sup|
|00000c90| 70 72 65 73 73 20 6d 75 | 6c 74 69 70 6c 65 20 69 |press mu|ltiple i|
|00000ca0| 6e 63 6c 75 73 69 6f 6e | 73 20 6f 66 20 74 68 69 |nclusion|s of thi|
|00000cb0| 73 20 66 69 6c 65 20 2a | 2f 0d 23 64 65 66 69 6e |s file *|/.#defin|
|00000cc0| 65 20 5f 4c 55 4d 49 4e | 41 4e 43 45 5f 0d 0d 23 |e _LUMIN|ANCE_..#|
|00000cd0| 69 66 6e 64 65 66 20 5f | 5f 51 55 49 43 4b 44 52 |ifndef _|_QUICKDR|
|00000ce0| 41 57 5f 5f 0d 09 23 69 | 6e 63 6c 75 64 65 20 3c |AW__..#i|nclude <|
|00000cf0| 51 75 69 63 6b 44 72 61 | 77 2e 68 3e 0d 23 65 6e |QuickDra|w.h>.#en|
|00000d00| 64 69 66 0d 23 69 66 6e | 64 65 66 20 5f 5f 53 4f |dif.#ifn|def __SO|
|00000d10| 55 4e 44 5f 5f 0d 09 23 | 69 6e 63 6c 75 64 65 20 |UND__..#|include |
|00000d20| 3c 53 6f 75 6e 64 2e 68 | 3e 0d 23 65 6e 64 69 66 |<Sound.h|>.#endif|
|00000d30| 0d 0d 2f 2a 20 4c 49 4e | 45 41 52 5f 56 5f 44 4f |../* LIN|EAR_V_DO|
|00000d40| 4d 41 49 4e 20 69 73 20 | 74 68 65 20 6d 61 78 69 |MAIN is |the maxi|
|00000d50| 6d 75 6d 20 69 6e 74 65 | 72 76 61 6c 20 69 6e 20 |mum inte|rval in |
|00000d60| 56 20 6f 76 65 72 20 77 | 68 69 63 68 20 74 68 65 |V over w|hich the|
|00000d70| 20 67 61 6d 6d 61 20 66 | 75 6e 63 74 69 6f 6e 20 | gamma f|unction |
|00000d80| 69 73 0d 74 6f 20 62 65 | 20 61 73 73 75 6d 65 64 |is.to be| assumed|
|00000d90| 20 6c 69 6e 65 61 72 20 | 62 79 20 4c 54 6f 56 28 | linear |by LToV(|
|00000da0| 29 2e 20 54 68 65 20 76 | 61 6c 75 65 20 34 20 67 |). The v|alue 4 g|
|00000db0| 69 76 65 73 20 61 6c 6d | 6f 73 74 20 74 68 65 20 |ives alm|ost the |
|00000dc0| 73 61 6d 65 20 61 63 63 | 75 72 61 63 79 20 61 73 |same acc|uracy as|
|00000dd0| 20 31 2c 20 79 65 74 0d | 72 65 73 75 6c 74 73 20 | 1, yet.|results |
|00000de0| 69 6e 20 53 65 74 4c 75 | 6d 69 6e 61 6e 63 65 73 |in SetLu|minances|
|00000df0| 28 29 20 6f 6e 20 61 20 | 4d 61 63 20 49 49 20 74 |() on a |Mac II t|
|00000e00| 61 6b 69 6e 67 20 6f 6e | 6c 79 20 32 39 20 6d 73 |aking on|ly 29 ms|
|00000e10| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 35 30 20 6d | instead| of 50 m|
|00000e20| 73 2e 20 0d 53 65 65 20 | 5f 4c 54 6f 56 28 29 20 |s. .See |_LToV() |
|00000e30| 69 6e 20 4c 75 6d 69 6e | 61 6e 63 65 2e 63 20 20 |in Lumin|ance.c |
|00000e40| 66 6f 72 20 6d 6f 72 65 | 20 69 6e 66 6f 72 6d 61 |for more| informa|
|00000e50| 74 69 6f 6e 2e 20 2a 2f | 0d 0d 23 64 65 66 69 6e |tion. */|..#defin|
|00000e60| 65 20 4d 41 43 49 4e 54 | 4f 53 48 09 31 09 09 2f |e MACINT|OSH.1../|
|00000e70| 2a 20 73 65 74 20 74 6f | 20 30 20 74 6f 20 75 73 |* set to| 0 to us|
|00000e80| 65 20 6f 6e 20 61 6e 79 | 20 6f 74 68 65 72 20 63 |e on any| other c|
|00000e90| 6f 6d 70 75 74 65 72 20 | 2a 2f 0d 23 64 65 66 69 |omputer |*/.#defi|
|00000ea0| 6e 65 20 4c 49 4e 45 41 | 52 5f 56 5f 44 4f 4d 41 |ne LINEA|R_V_DOMA|
|00000eb0| 49 4e 20 34 09 2f 2a 20 | 73 65 65 20 61 62 6f 76 |IN 4./* |see abov|
|00000ec0| 65 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 46 41 53 |e */.#de|fine FAS|
|00000ed0| 54 5f 4c 55 4d 49 4e 41 | 4e 43 45 20 31 09 2f 2a |T_LUMINA|NCE 1./*|
|00000ee0| 20 31 20 66 6f 72 20 46 | 69 78 65 64 20 6d 61 74 | 1 for F|ixed mat|
|00000ef0| 68 20 28 74 77 69 63 65 | 20 61 73 20 66 61 73 74 |h (twice| as fast|
|00000f00| 29 2c 20 30 20 66 6f 72 | 20 64 6f 75 62 6c 65 20 |), 0 for| double |
|00000f10| 6d 61 74 68 20 2a 2f 0d | 23 64 65 66 69 6e 65 20 |math */.|#define |
|00000f20| 44 41 43 53 20 33 09 09 | 09 09 2f 2a 20 6e 75 6d |DACS 3..|../* num|
|00000f30| 62 65 72 20 6f 66 20 64 | 69 67 69 74 61 6c 2d 74 |ber of d|igital-t|
|00000f40| 6f 2d 61 6e 61 6c 6f 67 | 20 63 6f 6e 76 65 72 74 |o-analog| convert|
|00000f50| 65 72 73 20 74 68 61 74 | 20 77 65 20 73 75 70 70 |ers that| we supp|
|00000f60| 6f 72 74 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 43 |ort */.#|define C|
|00000f70| 4f 4c 4f 52 53 20 32 35 | 36 09 09 09 2f 2a 20 73 |OLORS 25|6.../* s|
|00000f80| 69 7a 65 20 6f 66 20 43 | 6f 6c 6f 72 53 70 65 63 |ize of C|olorSpec|
|00000f90| 20 74 61 62 6c 65 20 2a | 2f 0d 23 64 65 66 69 6e | table *|/.#defin|
|00000fa0| 65 20 4d 41 58 5f 43 4f | 45 46 46 49 43 49 45 4e |e MAX_CO|EFFICIEN|
|00000fb0| 54 53 20 39 09 2f 2a 20 | 70 6f 6c 79 6e 6f 6d 69 |TS 9./* |polynomi|
|00000fc0| 61 6c 20 66 69 74 20 2a | 2f 0d 23 64 65 66 69 6e |al fit *|/.#defin|
|00000fd0| 65 20 4c 55 4d 49 4e 41 | 4e 43 45 53 5f 49 4e 5f |e LUMINA|NCES_IN_|
|00000fe0| 54 41 42 4c 45 20 31 32 | 38 09 2f 2a 20 73 69 7a |TABLE 12|8./* siz|
|00000ff0| 65 20 6f 66 20 67 61 6d | 6d 61 20 74 61 62 6c 65 |e of gam|ma table|
|00001000| 20 2a 2f 0d 0d 23 69 66 | 20 46 41 53 54 5f 4c 55 | */..#if| FAST_LU|
|00001010| 4d 49 4e 41 4e 43 45 20 | 26 20 21 64 65 66 69 6e |MINANCE |& !defin|
|00001020| 65 64 28 5f 5f 54 4f 4f | 4c 55 54 49 4c 53 5f 5f |ed(__TOO|LUTILS__|
|00001030| 29 0d 09 23 69 6e 63 6c | 75 64 65 20 3c 54 6f 6f |)..#incl|ude <Too|
|00001040| 6c 55 74 69 6c 73 2e 68 | 3e 09 2f 2a 20 70 72 6f |lUtils.h|>./* pro|
|00001050| 74 6f 74 79 70 65 73 20 | 66 6f 72 20 46 69 78 4d |totypes |for FixM|
|00001060| 75 6c 20 65 74 63 2e 20 | 2a 2f 0d 23 65 6e 64 69 |ul etc. |*/.#endi|
|00001070| 66 0d 0d 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |f..typed|ef struc|
|00001080| 74 7b 0d 09 43 6f 6c 6f | 72 53 70 65 63 20 74 61 |t{..Colo|rSpec ta|
|00001090| 62 6c 65 5b 43 4f 4c 4f | 52 53 5d 3b 09 2f 2a 20 |ble[COLO|RS];./* |
|000010a0| 61 20 74 61 62 6c 65 20 | 6f 66 20 76 61 6c 75 65 |a table |of value|
|000010b0| 73 20 64 65 73 74 69 6e | 65 64 20 66 6f 72 20 74 |s destin|ed for t|
|000010c0| 68 65 20 63 6c 75 74 20 | 2a 2f 0d 7d 20 43 6c 75 |he clut |*/.} Clu|
|000010d0| 74 3b 0d 0d 65 6e 75 6d | 20 7b 4d 69 63 68 65 6c |t;..enum| {Michel|
|000010e0| 73 6f 6e 2c 57 65 62 65 | 72 7d 3b 09 2f 2a 20 63 |son,Webe|r};./* c|
|000010f0| 6f 6e 74 72 61 73 74 54 | 79 70 65 20 2a 2f 0d 0d |ontrastT|ype */..|
|00001100| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 20 7b |typedef |struct {|
|00001110| 0d 09 73 68 6f 72 74 20 | 65 78 69 73 74 73 3b 09 |..short |exists;.|
|00001120| 2f 2a 20 73 65 74 20 74 | 6f 20 6c 75 6d 69 6e 61 |/* set t|o lumina|
|00001130| 6e 63 65 53 65 74 20 6f | 6e 63 65 20 74 68 69 73 |nceSet o|nce this|
|00001140| 20 74 61 62 6c 65 20 68 | 61 73 20 62 65 65 6e 20 | table h|as been |
|00001150| 69 6e 69 74 69 61 6c 69 | 7a 65 64 20 2a 2f 0d 09 |initiali|zed */..|
|00001160| 73 68 6f 72 74 20 6c 61 | 74 65 73 74 49 6e 64 65 |short la|testInde|
|00001170| 78 3b 2f 2a 20 6c 61 73 | 74 2d 75 73 65 64 20 69 |x;/* las|t-used i|
|00001180| 6e 64 65 78 20 6f 66 20 | 4c 52 2e 4c 2e 5f 4c 75 |ndex of |LR.L._Lu|
|00001190| 5b 5d 20 69 73 20 67 6f | 6f 64 20 70 6c 61 63 65 |[] is go|od place|
|000011a0| 20 74 6f 20 73 74 61 72 | 74 20 73 65 61 72 63 68 | to star|t search|
|000011b0| 20 2a 2f 0d 09 23 69 66 | 20 46 41 53 54 5f 4c 55 | */..#if| FAST_LU|
|000011c0| 4d 49 4e 41 4e 43 45 0d | 09 09 46 69 78 65 64 20 |MINANCE.|..Fixed |
|000011d0| 5f 56 4d 69 6e 3b 09 2f | 2a 20 62 6f 75 6e 64 73 |_VMin;./|* bounds|
|000011e0| 20 6d 6f 6e 6f 74 6f 6e | 69 63 20 70 61 72 74 20 | monoton|ic part |
|000011f0| 6f 66 20 64 6f 6d 61 69 | 6e 20 6f 66 20 67 61 6d |of domai|n of gam|
|00001200| 6d 61 20 66 75 6e 63 74 | 69 6f 6e 20 2a 2f 0d 09 |ma funct|ion */..|
|00001210| 09 46 69 78 65 64 20 5f | 56 4d 61 78 3b 09 2f 2a |.Fixed _|VMax;./*|
|00001220| 20 62 6f 75 6e 64 73 20 | 6d 6f 6e 6f 74 6f 6e 69 | bounds |monotoni|
|00001230| 63 20 70 61 72 74 20 6f | 66 20 64 6f 6d 61 69 6e |c part o|f domain|
|00001240| 20 6f 66 20 67 61 6d 6d | 61 20 66 75 6e 63 74 69 | of gamm|a functi|
|00001250| 6f 6e 20 2a 2f 0d 09 09 | 46 69 78 65 64 20 5f 64 |on */...|Fixed _d|
|00001260| 56 3b 09 09 2f 2a 20 56 | 20 3d 20 5f 56 4d 69 6e |V;../* V| = _VMin|
|00001270| 2c 5f 56 4d 69 6e 2b 5f | 64 56 2c 5f 56 4d 69 6e |,_VMin+_|dV,_VMin|
|00001280| 2b 32 64 56 2c 5f 56 4d | 69 6e 2b 33 64 56 2c 20 |+2dV,_VM|in+3dV, |
|00001290| 2e 20 2e 20 2e 20 2c 5f | 56 4d 61 78 20 2a 2f 0d |. . . ,_|VMax */.|
|000012a0| 09 09 09 09 09 09 2f 2a | 20 5f 64 56 3d 28 5f 56 |....../*| _dV=(_V|
|000012b0| 4d 61 78 2d 5f 56 4d 69 | 6e 29 2f 28 4c 55 4d 49 |Max-_VMi|n)/(LUMI|
|000012c0| 4e 41 4e 43 45 53 5f 49 | 4e 5f 54 41 42 4c 45 2d |NANCES_I|N_TABLE-|
|000012d0| 31 29 20 2a 2f 0d 09 09 | 46 69 78 65 64 20 5f 4c |1) */...|Fixed _L|
|000012e0| 75 5b 4c 55 4d 49 4e 41 | 4e 43 45 53 5f 49 4e 5f |u[LUMINA|NCES_IN_|
|000012f0| 54 41 42 4c 45 5d 3b 0d | 09 09 6c 6f 6e 67 20 4c |TABLE];.|..long L|
|00001300| 53 68 69 66 74 3b 09 2f | 2a 20 62 69 74 20 73 68 |Shift;./|* bit sh|
|00001310| 69 66 74 20 74 6f 20 62 | 65 20 61 70 70 6c 69 65 |ift to b|e applie|
|00001320| 64 20 74 6f 20 6c 75 6d | 69 6e 61 6e 63 65 20 64 |d to lum|inance d|
|00001330| 69 66 66 65 72 65 6e 63 | 65 73 20 2a 2f 0d 09 23 |ifferenc|es */..#|
|00001340| 65 6c 73 65 0d 09 09 64 | 6f 75 62 6c 65 20 5f 56 |else...d|ouble _V|
|00001350| 4d 69 6e 3b 09 2f 2a 20 | 62 6f 75 6e 64 73 20 6d |Min;./* |bounds m|
|00001360| 6f 6e 6f 74 6f 6e 69 63 | 20 70 61 72 74 20 6f 66 |onotonic| part of|
|00001370| 20 64 6f 6d 61 69 6e 20 | 6f 66 20 67 61 6d 6d 61 | domain |of gamma|
|00001380| 20 66 75 6e 63 74 69 6f | 6e 20 2a 2f 0d 09 09 64 | functio|n */...d|
|00001390| 6f 75 62 6c 65 20 5f 56 | 4d 61 78 3b 09 2f 2a 20 |ouble _V|Max;./* |
|000013a0| 62 6f 75 6e 64 73 20 6d | 6f 6e 6f 74 6f 6e 69 63 |bounds m|onotonic|
|000013b0| 20 70 61 72 74 20 6f 66 | 20 64 6f 6d 61 69 6e 20 | part of| domain |
|000013c0| 6f 66 20 67 61 6d 6d 61 | 20 66 75 6e 63 74 69 6f |of gamma| functio|
|000013d0| 6e 20 2a 2f 0d 09 09 64 | 6f 75 62 6c 65 20 5f 64 |n */...d|ouble _d|
|000013e0| 56 3b 09 09 2f 2a 20 56 | 20 3d 20 5f 56 4d 69 6e |V;../* V| = _VMin|
|000013f0| 2c 5f 56 4d 69 6e 2b 5f | 64 56 2c 5f 56 4d 69 6e |,_VMin+_|dV,_VMin|
|00001400| 2b 32 64 56 2c 5f 56 4d | 69 6e 2b 33 64 56 2c 20 |+2dV,_VM|in+3dV, |
|00001410| 2e 20 2e 20 2e 20 2c 5f | 56 4d 61 78 20 2a 2f 0d |. . . ,_|VMax */.|
|00001420| 09 09 09 09 09 09 2f 2a | 20 5f 64 56 3d 28 5f 56 |....../*| _dV=(_V|
|00001430| 4d 61 78 2d 5f 56 4d 69 | 6e 29 2f 28 4c 55 4d 49 |Max-_VMi|n)/(LUMI|
|00001440| 4e 41 4e 43 45 53 5f 49 | 4e 5f 54 41 42 4c 45 2d |NANCES_I|N_TABLE-|
|00001450| 31 29 20 2a 2f 0d 09 09 | 64 6f 75 62 6c 65 20 5f |1) */...|double _|
|00001460| 4c 75 5b 4c 55 4d 49 4e | 41 4e 43 45 53 5f 49 4e |Lu[LUMIN|ANCES_IN|
|00001470| 5f 54 41 42 4c 45 5d 3b | 0d 09 23 65 6e 64 69 66 |_TABLE];|..#endif|
|00001480| 0d 7d 20 6c 75 6d 69 6e | 61 6e 63 65 54 61 62 6c |.} lumin|anceTabl|
|00001490| 65 3b 0d 0d 74 79 70 65 | 64 65 66 20 73 74 72 75 |e;..type|def stru|
|000014a0| 63 74 20 7b 09 2f 2a 20 | 22 74 61 62 6c 65 22 20 |ct {./* |"table" |
|000014b0| 4d 55 53 54 20 62 65 20 | 74 68 65 20 66 69 72 73 |MUST be |the firs|
|000014c0| 74 20 74 68 69 6e 67 20 | 69 6e 20 74 68 65 20 73 |t thing |in the s|
|000014d0| 74 72 75 63 74 75 72 65 | 21 20 2a 2f 0d 09 43 6f |tructure|! */..Co|
|000014e0| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 5b 43 4f |lorSpec |table[CO|
|000014f0| 4c 4f 52 53 5d 3b 2f 2a | 20 61 20 74 61 62 6c 65 |LORS];/*| a table|
|00001500| 20 6f 66 20 76 61 6c 75 | 65 73 20 64 65 73 74 69 | of valu|es desti|
|00001510| 6e 65 64 20 66 6f 72 20 | 74 68 65 20 63 6c 75 74 |ned for |the clut|
|00001520| 20 2a 2f 0d 09 73 68 6f | 72 74 20 64 61 63 53 69 | */..sho|rt dacSi|
|00001530| 7a 65 3b 09 09 2f 2a 20 | 62 69 74 73 20 2a 2f 0d |ze;../* |bits */.|
|00001540| 09 73 68 6f 72 74 20 6c | 65 66 74 53 68 69 66 74 |.short l|eftShift|
|00001550| 3b 09 2f 2a 20 62 69 74 | 20 73 68 69 66 74 20 6f |;./* bit| shift o|
|00001560| 66 20 56 20 74 6f 20 70 | 72 6f 64 75 63 65 20 31 |f V to p|roduce 1|
|00001570| 36 20 62 69 74 20 76 61 | 6c 75 65 3d 31 36 2d 64 |6 bit va|lue=16-d|
|00001580| 61 63 53 69 7a 65 20 2a | 2f 0d 09 73 68 6f 72 74 |acSize *|/..short|
|00001590| 20 56 4d 69 6e 2c 56 4d | 61 78 3b 09 2f 2a 20 6c | VMin,VM|ax;./* l|
|000015a0| 6f 77 65 73 74 20 61 6e | 64 20 68 69 67 68 65 73 |owest an|d highes|
|000015b0| 74 20 44 41 43 20 76 61 | 6c 75 65 73 20 61 6c 6c |t DAC va|lues all|
|000015c0| 6f 77 65 64 3a 20 30 20 | 61 6e 64 20 32 35 35 20 |owed: 0 |and 255 |
|000015d0| 2a 2f 0d 09 64 6f 75 62 | 6c 65 20 4c 4d 69 6e 2c |*/..doub|le LMin,|
|000015e0| 4c 4d 61 78 3b 09 2f 2a | 20 6c 75 6d 69 6e 61 6e |LMax;./*| luminan|
|000015f0| 63 65 73 20 61 74 20 56 | 4d 69 6e 20 26 20 56 4d |ces at V|Min & VM|
|00001600| 61 78 20 2a 2f 0d 09 64 | 6f 75 62 6c 65 20 4c 42 |ax */..d|ouble LB|
|00001610| 61 63 6b 67 72 6f 75 6e | 64 3b 09 2f 2a 20 74 68 |ackgroun|d;./* th|
|00001620| 65 20 62 61 63 6b 67 72 | 6f 75 6e 64 20 6c 75 6d |e backgr|ound lum|
|00001630| 69 6e 61 6e 63 65 20 75 | 73 65 64 20 64 75 72 69 |inance u|sed duri|
|00001640| 6e 67 20 6c 75 6d 69 6e | 61 6e 63 65 20 63 61 6c |ng lumin|ance cal|
|00001650| 69 62 72 61 74 69 6f 6e | 20 2a 2f 0d 09 73 68 6f |ibration| */..sho|
|00001660| 72 74 20 56 42 61 63 6b | 67 72 6f 75 6e 64 3b 09 |rt VBack|ground;.|
|00001670| 2f 2a 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |/* the b|ackgroun|
|00001680| 64 20 6e 75 6d 62 65 72 | 20 75 73 65 64 20 64 75 |d number| used du|
|00001690| 72 69 6e 67 20 6c 75 6d | 69 6e 61 6e 63 65 20 63 |ring lum|inance c|
|000016a0| 61 6c 69 62 72 61 74 69 | 6f 6e 20 2a 2f 0d 09 73 |alibrati|on */..s|
|000016b0| 68 6f 72 74 20 73 63 72 | 65 65 6e 3b 09 09 2f 2a |hort scr|een;../*|
|000016c0| 20 64 65 76 69 63 65 3d | 47 65 74 53 63 72 65 65 | device=|GetScree|
|000016d0| 6e 44 65 76 69 63 65 28 | 4c 52 2e 73 63 72 65 65 |nDevice(|LR.scree|
|000016e0| 6e 29 3b 20 2a 2f 0d 09 | 63 68 61 72 20 2a 69 64 |n); */..|char *id|
|000016f0| 3b 09 09 09 2f 2a 20 6d | 61 6b 65 2c 20 6d 6f 64 |;.../* m|ake, mod|
|00001700| 65 6c 2c 20 61 6e 64 20 | 73 65 72 69 61 6c 20 6e |el, and |serial n|
|00001710| 75 6d 62 65 72 20 6f 66 | 20 6d 6f 6e 69 74 6f 72 |umber of| monitor|
|00001720| 20 2a 2f 0d 09 63 68 61 | 72 20 2a 6e 61 6d 65 3b | */..cha|r *name;|
|00001730| 09 09 09 2f 2a 20 69 6e | 66 6f 72 6d 61 6c 20 6e |.../* in|formal n|
|00001740| 61 6d 65 20 6f 66 20 6d | 6f 6e 69 74 6f 72 20 2a |ame of m|onitor *|
|00001750| 2f 0d 09 63 68 61 72 20 | 2a 64 61 74 65 3b 09 09 |/..char |*date;..|
|00001760| 09 2f 2a 20 77 68 65 6e | 20 63 61 6c 69 62 72 61 |./* when| calibra|
|00001770| 74 65 64 20 2a 2f 0d 09 | 63 68 61 72 20 2a 6e 6f |ted */..|char *no|
|00001780| 74 65 73 3b 09 09 2f 2a | 20 64 65 73 63 72 69 70 |tes;../*| descrip|
|00001790| 74 69 6f 6e 20 6f 66 20 | 63 61 6c 69 62 20 63 6f |tion of |calib co|
|000017a0| 6e 64 69 74 69 6f 6e 73 | 3a 20 77 68 6f 20 26 20 |nditions|: who & |
|000017b0| 68 6f 77 20 2a 2f 0d 09 | 64 6f 75 62 6c 65 20 64 |how */..|double d|
|000017c0| 70 69 3b 09 09 09 2f 2a | 20 70 69 78 65 6c 73 20 |pi;.../*| pixels |
|000017d0| 70 65 72 20 69 6e 63 68 | 20 2a 2f 0d 09 64 6f 75 |per inch| */..dou|
|000017e0| 62 6c 65 20 48 7a 3b 09 | 09 09 2f 2a 20 66 72 61 |ble Hz;.|../* fra|
|000017f0| 6d 65 73 20 70 65 72 20 | 73 65 63 6f 6e 64 20 2a |mes per |second *|
|00001800| 2f 0d 09 63 68 61 72 20 | 2a 75 6e 69 74 73 3b 09 |/..char |*units;.|
|00001810| 09 2f 2a 20 4c 75 6d 69 | 6e 61 6e 63 65 20 75 6e |./* Lumi|nance un|
|00001820| 69 74 73 2c 20 65 2e 67 | 2e 20 22 63 64 2f 6d 5e |its, e.g|. "cd/m^|
|00001830| 32 22 20 2a 2f 0d 09 6c | 6f 6e 67 20 63 6f 65 66 |2" */..l|ong coef|
|00001840| 66 69 63 69 65 6e 74 73 | 3b 09 2f 2a 20 74 68 65 |ficients|;./* the|
|00001850| 20 6e 75 6d 62 65 72 20 | 6f 66 20 63 6f 65 66 66 | number |of coeff|
|00001860| 69 63 69 65 6e 74 73 2c | 20 6e 6f 74 20 6d 6f 72 |icients,| not mor|
|00001870| 65 20 74 68 61 6e 20 4d | 41 58 5f 43 4f 45 46 46 |e than M|AX_COEFF|
|00001880| 49 43 49 45 4e 54 53 2c | 20 2a 2f 0d 09 09 09 09 |ICIENTS,| */.....|
|00001890| 09 09 2f 2a 09 75 73 75 | 61 6c 6c 79 20 39 2c 20 |../*.usu|ally 9, |
|000018a0| 67 69 76 69 6e 67 20 61 | 6e 20 38 74 68 2d 6f 72 |giving a|n 8th-or|
|000018b0| 64 65 72 20 70 6f 6c 79 | 6e 6f 6d 69 61 6c 2c 20 |der poly|nomial, |
|000018c0| 2a 2f 0d 09 64 6f 75 62 | 6c 65 20 70 5b 4d 41 58 |*/..doub|le p[MAX|
|000018d0| 5f 43 4f 45 46 46 49 43 | 49 45 4e 54 53 5d 3b 0d |_COEFFIC|IENTS];.|
|000018e0| 09 09 09 09 09 09 2f 2a | 20 63 6f 65 66 66 69 63 |....../*| coeffic|
|000018f0| 69 65 6e 74 73 20 6f 66 | 20 61 20 70 6f 6c 79 6e |ients of| a polyn|
|00001900| 6f 6d 69 61 6c 20 69 6e | 20 76 61 6c 75 65 20 56 |omial in| value V|
|00001910| 2c 20 79 69 65 6c 64 69 | 6e 67 20 4c 20 69 6e 20 |, yieldi|ng L in |
|00001920| 63 64 2f 6d 5e 32 20 2a | 2f 0d 09 64 6f 75 62 6c |cd/m^2 *|/..doubl|
|00001930| 65 20 70 6f 6c 79 6e 6f | 6d 69 61 6c 45 72 72 6f |e polyno|mialErro|
|00001940| 72 3b 09 2f 2a 20 52 4d | 53 20 65 72 72 6f 72 20 |r;./* RM|S error |
|00001950| 6f 66 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 20 66 69 |of polyn|omial fi|
|00001960| 74 20 2a 2f 0d 09 09 09 | 09 09 09 2f 2a 20 4c 28 |t */....|.../* L(|
|00001970| 56 29 3d 70 5b 30 5d 2b | 70 5b 31 5d 2a 56 2b 70 |V)=p[0]+|p[1]*V+p|
|00001980| 5b 32 5d 2a 56 2a 56 2b | 20 2e 20 2e 20 2e 20 b1 |[2]*V*V+| . . . .|
|00001990| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 45 72 72 6f 72 20 |polynomi|alError |
|000019a0| 2a 2f 0d 09 64 6f 75 62 | 6c 65 20 71 5b 33 5d 3b |*/..doub|le q[3];|
|000019b0| 09 09 2f 2a 20 63 6f 65 | 66 66 69 63 69 65 6e 74 |../* coe|fficient|
|000019c0| 73 20 6f 66 20 61 20 71 | 75 61 64 72 61 74 69 63 |s of a q|uadratic|
|000019d0| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 69 6e 20 56 | polynom|ial in V|
|000019e0| 20 2a 2f 0d 09 64 6f 75 | 62 6c 65 20 71 75 61 64 | */..dou|ble quad|
|000019f0| 72 61 74 69 63 45 72 72 | 6f 72 3b 09 2f 2a 20 52 |raticErr|or;./* R|
|00001a00| 4d 53 20 65 72 72 6f 72 | 20 6f 66 20 71 75 61 64 |MS error| of quad|
|00001a10| 72 61 74 69 63 20 66 69 | 74 20 2a 2f 0d 09 09 09 |ratic fi|t */....|
|00001a20| 09 09 09 2f 2a 20 4c 28 | 56 29 3d 71 5b 30 5d 2b |.../* L(|V)=q[0]+|
|00001a30| 71 5b 31 5d 2a 56 2b 71 | 5b 32 5d 2a 56 2a 56 b1 |q[1]*V+q|[2]*V*V.|
|00001a40| 71 75 61 64 72 61 74 69 | 63 45 72 72 6f 72 20 2a |quadrati|cError *|
|00001a50| 2f 0d 09 64 6f 75 62 6c | 65 20 70 6f 77 65 72 5b |/..doubl|e power[|
|00001a60| 34 5d 3b 09 2f 2a 20 63 | 6f 65 66 66 69 63 69 65 |4];./* c|oefficie|
|00001a70| 6e 74 73 20 6f 66 20 61 | 20 70 6f 77 65 72 20 6c |nts of a| power l|
|00001a80| 61 77 20 66 69 74 20 2a | 2f 0d 09 64 6f 75 62 6c |aw fit *|/..doubl|
|00001a90| 65 20 70 6f 77 65 72 45 | 72 72 6f 72 3b 09 2f 2a |e powerE|rror;./*|
|00001aa0| 20 52 4d 53 20 65 72 72 | 6f 72 20 6f 66 20 70 6f | RMS err|or of po|
|00001ab0| 77 65 72 20 6c 61 77 20 | 66 69 74 20 2a 2f 0d 09 |wer law |fit */..|
|00001ac0| 09 09 09 09 09 2f 2a 20 | 4c 28 56 29 3d 70 6f 77 |...../* |L(V)=pow|
|00001ad0| 65 72 5b 30 5d 2b 52 65 | 63 74 69 66 79 28 70 6f |er[0]+Re|ctify(po|
|00001ae0| 77 65 72 5b 31 5d 2b 70 | 6f 77 65 72 5b 32 5d 2a |wer[1]+p|ower[2]*|
|00001af0| 56 29 5e 70 6f 77 65 72 | 5b 33 5d b1 70 6f 77 65 |V)^power|[3].powe|
|00001b00| 72 45 72 72 6f 72 20 2a | 2f 0d 09 09 09 09 09 09 |rError *|/.......|
|00001b10| 2f 2a 20 52 65 63 74 69 | 66 79 28 78 29 3d 78 20 |/* Recti|fy(x)=x |
|00001b20| 69 66 20 78 b3 30 2c 20 | 52 65 63 74 69 66 79 28 |if x.0, |Rectify(|
|00001b30| 78 29 3d 30 20 69 66 20 | 78 3c 30 20 2a 2f 0d 09 |x)=0 if |x<0 */..|
|00001b40| 09 09 09 09 09 2f 2a 20 | 50 65 6c 6c 69 20 26 20 |...../* |Pelli & |
|00001b50| 5a 68 61 6e 67 20 28 31 | 39 39 31 29 20 45 71 73 |Zhang (1|991) Eqs|
|00001b60| 2e 39 26 31 30 20 75 73 | 65 20 73 79 6d 62 6f 6c |.9&10 us|e symbol|
|00001b70| 73 3a 20 2a 2f 0d 09 09 | 09 09 09 09 2f 2a 20 76 |s: */...|..../* v|
|00001b80| 3d 56 2f 32 35 35 2c 20 | 61 6c 70 68 61 3d 70 6f |=V/255, |alpha=po|
|00001b90| 77 65 72 5b 30 5d 2c 20 | 62 65 74 61 3d 70 6f 77 |wer[0], |beta=pow|
|00001ba0| 65 72 5b 31 5d 2c 20 6b | 61 70 70 61 3d 70 6f 77 |er[1], k|appa=pow|
|00001bb0| 65 72 5b 32 5d 2a 32 35 | 35 2c 20 2a 2f 0d 09 09 |er[2]*25|5, */...|
|00001bc0| 09 09 09 09 2f 2a 20 67 | 61 6d 6d 61 3d 70 6f 77 |..../* g|amma=pow|
|00001bd0| 65 72 5b 33 5d 20 2a 2f | 0d 09 64 6f 75 62 6c 65 |er[3] */|..double|
|00001be0| 20 66 69 78 65 64 50 6f | 77 65 72 5b 34 5d 3b 09 | fixedPo|wer[4];.|
|00001bf0| 2f 2a 20 63 6f 65 66 66 | 69 63 69 65 6e 74 73 20 |/* coeff|icients |
|00001c00| 6f 66 20 61 20 70 6f 77 | 65 72 20 6c 61 77 20 66 |of a pow|er law f|
|00001c10| 69 74 2c 20 77 69 74 68 | 20 66 69 78 65 64 20 65 |it, with| fixed e|
|00001c20| 78 70 6f 6e 65 6e 74 20 | 2a 2f 0d 09 64 6f 75 62 |xponent |*/..doub|
|00001c30| 6c 65 20 66 69 78 65 64 | 50 6f 77 65 72 45 72 72 |le fixed|PowerErr|
|00001c40| 6f 72 3b 09 2f 2a 20 52 | 4d 53 20 65 72 72 6f 72 |or;./* R|MS error|
|00001c50| 20 6f 66 20 70 6f 77 65 | 72 20 6c 61 77 20 66 69 | of powe|r law fi|
|00001c60| 74 20 2a 2f 0d 09 09 09 | 09 09 09 2f 2a 20 4c 28 |t */....|.../* L(|
|00001c70| 56 29 3d 66 69 78 65 64 | 50 6f 77 65 72 5b 30 5d |V)=fixed|Power[0]|
|00001c80| 2b 52 65 63 74 69 66 79 | 28 66 69 78 65 64 50 6f |+Rectify|(fixedPo|
|00001c90| 77 65 72 5b 31 5d 2b 66 | 69 78 65 64 50 6f 77 65 |wer[1]+f|ixedPowe|
|00001ca0| 72 5b 32 5d 2a 56 29 5e | 66 69 78 65 64 50 6f 77 |r[2]*V)^|fixedPow|
|00001cb0| 65 72 5b 33 5d b1 66 69 | 78 65 64 50 6f 77 65 72 |er[3].fi|xedPower|
|00001cc0| 45 72 72 6f 72 20 2a 2f | 0d 09 64 6f 75 62 6c 65 |Error */|..double|
|00001cd0| 20 72 2c 67 2c 62 3b 09 | 09 2f 2a 20 76 6f 6c 74 | r,g,b;.|./* volt|
|00001ce0| 61 67 65 20 67 61 69 6e | 73 20 66 6f 72 20 74 68 |age gain|s for th|
|00001cf0| 65 20 74 68 72 65 65 20 | 70 61 74 68 77 61 79 73 |e three |pathways|
|00001d00| 2e 20 72 2b 67 2b 62 3d | 31 2e 20 41 6c 6c 20 6d |. r+g+b=|1. All m|
|00001d10| 75 73 74 20 62 65 20 b3 | 30 2e 20 2a 2f 0d 09 64 |ust be .|0. */..d|
|00001d20| 6f 75 62 6c 65 20 67 61 | 69 6e 41 63 63 75 72 61 |ouble ga|inAccura|
|00001d30| 63 79 3b 2f 2a 20 70 6f | 73 73 69 62 6c 65 20 65 |cy;/* po|ssible e|
|00001d40| 72 72 6f 72 20 69 6e 20 | 72 2c 67 2c 62 20 2a 2f |rror in |r,g,b */|
|00001d50| 0d 09 64 6f 75 62 6c 65 | 20 67 6d 3b 09 09 09 2f |..double| gm;.../|
|00001d60| 2a 20 54 68 65 20 6d 6f | 6e 69 74 6f 72 27 73 20 |* The mo|nitor's |
|00001d70| 63 6f 6e 74 72 61 73 74 | 20 67 61 69 6e 2e 20 54 |contrast| gain. T|
|00001d80| 68 65 20 4d 69 63 68 65 | 6c 73 6f 6e 20 63 6f 6e |he Miche|lson con|
|00001d90| 74 72 61 73 74 20 70 72 | 6f 64 75 63 65 64 20 62 |trast pr|oduced b|
|00001da0| 79 0d 09 09 09 09 09 09 | 09 61 20 73 6d 61 6c 6c |y.......|.a small|
|00001db0| 20 c6 76 20 61 74 20 74 | 68 65 20 62 61 63 6b 67 | .v at t|he backg|
|00001dc0| 72 6f 75 6e 64 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |round lu|minance |
|00001dd0| 69 73 20 63 3d 67 6d 2a | c6 76 20 2a 2f 0d 09 2f |is c=gm*|.v */../|
|00001de0| 2a 20 54 68 65 20 72 65 | 73 74 20 6f 66 20 74 68 |* The re|st of th|
|00001df0| 65 20 70 61 72 61 6d 65 | 74 65 72 73 20 61 72 65 |e parame|ters are|
|00001e00| 20 66 6f 72 20 74 65 6d | 70 6f 72 61 72 79 20 73 | for tem|porary s|
|00001e10| 74 6f 72 61 67 65 20 62 | 79 20 53 65 74 4c 75 6d |torage b|y SetLum|
|00001e20| 69 6e 61 6e 63 65 52 61 | 6e 67 65 28 29 20 2a 2f |inanceRa|nge() */|
|00001e30| 0d 09 64 6f 75 62 6c 65 | 20 6c 6f 77 4c 75 6d 69 |..double| lowLumi|
|00001e40| 6e 61 6e 63 65 3b 09 2f | 2a 20 74 68 65 20 62 6f |nance;./|* the bo|
|00001e50| 74 74 6f 6d 20 6f 66 20 | 74 68 65 20 72 61 6e 67 |ttom of |the rang|
|00001e60| 65 20 2a 2f 0d 09 64 6f | 75 62 6c 65 20 68 69 67 |e */..do|uble hig|
|00001e70| 68 4c 75 6d 69 6e 61 6e | 63 65 3b 09 2f 2a 20 74 |hLuminan|ce;./* t|
|00001e80| 68 65 20 74 6f 70 20 6f | 66 20 74 68 65 20 72 61 |he top o|f the ra|
|00001e90| 6e 67 65 20 2a 2f 0d 09 | 73 68 6f 72 74 20 72 61 |nge */..|short ra|
|00001ea0| 6e 67 65 53 65 74 3b 09 | 09 09 2f 2a 20 61 20 63 |ngeSet;.|../* a c|
|00001eb0| 68 65 63 6b 20 74 68 61 | 74 20 74 68 65 20 72 61 |heck tha|t the ra|
|00001ec0| 6e 67 65 20 72 65 61 6c | 6c 79 20 68 61 73 20 62 |nge real|ly has b|
|00001ed0| 65 65 6e 20 73 65 74 20 | 2a 2f 0d 09 73 68 6f 72 |een set |*/..shor|
|00001ee0| 74 20 64 61 63 73 3b 09 | 09 09 09 2f 2a 20 74 68 |t dacs;.|.../* th|
|00001ef0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 61 63 73 |e number| of dacs|
|00001f00| 20 77 69 74 68 20 6e 6f | 6e 7a 65 72 6f 20 67 61 | with no|nzero ga|
|00001f10| 69 6e 2c 20 75 73 75 61 | 6c 6c 79 20 31 20 6f 72 |in, usua|lly 1 or|
|00001f20| 20 33 20 2a 2f 0d 09 73 | 68 6f 72 74 20 66 69 78 | 3 */..s|hort fix|
|00001f30| 65 64 3b 09 09 09 2f 2a | 20 74 68 65 20 6e 75 6d |ed;.../*| the num|
|00001f40| 62 65 72 20 6f 66 20 64 | 61 63 73 20 77 68 6f 73 |ber of d|acs whos|
|00001f50| 65 20 76 61 6c 75 65 20 | 77 69 6c 6c 20 62 65 20 |e value |will be |
|00001f60| 66 69 78 65 64 20 66 6f | 72 20 74 68 69 73 20 72 |fixed fo|r this r|
|00001f70| 61 6e 67 65 20 2a 2f 0d | 09 73 68 6f 72 74 20 64 |ange */.|.short d|
|00001f80| 61 63 5b 44 41 43 53 5d | 3b 09 09 2f 2a 20 77 68 |ac[DACS]|;../* wh|
|00001f90| 69 63 68 20 64 61 63 20 | 63 6f 72 72 65 73 70 6f |ich dac |correspo|
|00001fa0| 6e 64 73 20 74 6f 20 65 | 61 63 68 20 67 61 69 6e |nds to e|ach gain|
|00001fb0| 2c 20 72 3d 30 2c 67 3d | 31 2c 62 3d 32 20 2a 2f |, r=0,g=|1,b=2 */|
|00001fc0| 0d 09 64 6f 75 62 6c 65 | 20 67 61 69 6e 5b 44 41 |..double| gain[DA|
|00001fd0| 43 53 5d 3b 09 09 2f 2a | 20 74 68 65 20 6f 72 64 |CS];../*| the ord|
|00001fe0| 65 72 65 64 20 6e 6f 72 | 6d 61 6c 69 7a 65 64 20 |ered nor|malized |
|00001ff0| 67 61 69 6e 73 20 6f 66 | 20 74 68 65 20 56 69 64 |gains of| the Vid|
|00002000| 65 6f 20 41 74 74 65 6e | 75 61 74 6f 72 20 2a 2f |eo Atten|uator */|
|00002010| 0d 09 64 6f 75 62 6c 65 | 20 56 48 61 6c 66 53 74 |..double| VHalfSt|
|00002020| 65 70 3b 09 09 2f 2a 20 | 68 61 6c 66 20 61 20 73 |ep;../* |half a s|
|00002030| 74 65 70 20 6f 66 20 74 | 68 65 20 66 69 6e 65 73 |tep of t|he fines|
|00002040| 74 20 64 61 63 20 2a 2f | 0d 09 64 6f 75 62 6c 65 |t dac */|..double|
|00002050| 20 56 46 69 78 65 64 3b | 09 09 09 2f 2a 20 74 68 | VFixed;|.../* th|
|00002060| 65 20 76 61 6c 75 65 20 | 70 72 6f 64 75 63 65 64 |e value |produced|
|00002070| 20 62 79 20 74 68 65 20 | 66 69 78 65 64 20 64 61 | by the |fixed da|
|00002080| 63 73 20 2a 2f 0d 09 64 | 6f 75 62 6c 65 20 4c 4f |cs */..d|ouble LO|
|00002090| 66 66 73 65 74 3b 09 09 | 09 2f 2a 20 61 20 73 6d |ffset;..|./* a sm|
|000020a0| 61 6c 6c 20 73 68 69 66 | 74 20 6f 66 20 74 68 65 |all shif|t of the|
|000020b0| 20 72 65 71 75 65 73 74 | 65 64 20 6c 75 6d 69 6e | request|ed lumin|
|000020c0| 61 6e 63 65 20 72 61 6e | 67 65 20 2a 2f 0d 09 64 |ance ran|ge */..d|
|000020d0| 6f 75 62 6c 65 20 74 6f | 6c 65 72 61 6e 63 65 3b |ouble to|lerance;|
|000020e0| 09 09 2f 2a 20 74 68 65 | 20 6c 75 6d 69 6e 61 6e |../* the| luminan|
|000020f0| 63 65 20 65 72 72 6f 72 | 20 63 6f 72 72 65 73 70 |ce error| corresp|
|00002100| 6f 6e 64 69 6e 67 20 74 | 6f 20 68 61 6c 66 20 0d |onding t|o half .|
|00002110| 09 09 09 09 09 09 09 09 | 61 20 73 74 65 70 20 6f |........|a step o|
|00002120| 66 20 74 68 65 20 63 6f | 61 72 73 65 73 74 20 6f |f the co|arsest o|
|00002130| 66 20 74 68 65 20 76 61 | 72 69 61 62 6c 65 20 64 |f the va|riable d|
|00002140| 61 63 73 20 2a 2f 0d 09 | 23 69 66 20 46 41 53 54 |acs */..|#if FAST|
|00002150| 5f 4c 55 4d 49 4e 41 4e | 43 45 0d 09 09 46 69 78 |_LUMINAN|CE...Fix|
|00002160| 65 64 20 5f 67 61 69 6e | 5b 44 41 43 53 5d 3b 0d |ed _gain|[DACS];.|
|00002170| 09 09 46 69 78 65 64 20 | 5f 56 48 61 6c 66 53 74 |..Fixed |_VHalfSt|
|00002180| 65 70 3b 0d 09 09 46 69 | 78 65 64 20 5f 56 46 69 |ep;...Fi|xed _VFi|
|00002190| 78 65 64 3b 0d 09 09 46 | 69 78 65 64 20 5f 4c 4f |xed;...F|ixed _LO|
|000021a0| 66 66 73 65 74 3b 0d 09 | 09 46 69 78 65 64 20 5f |ffset;..|.Fixed _|
|000021b0| 74 6f 6c 65 72 61 6e 63 | 65 3b 0d 09 23 65 6c 73 |toleranc|e;..#els|
|000021c0| 65 0d 09 09 64 6f 75 62 | 6c 65 20 5f 67 61 69 6e |e...doub|le _gain|
|000021d0| 5b 44 41 43 53 5d 3b 0d | 09 09 64 6f 75 62 6c 65 |[DACS];.|..double|
|000021e0| 20 5f 56 48 61 6c 66 53 | 74 65 70 3b 0d 09 09 64 | _VHalfS|tep;...d|
|000021f0| 6f 75 62 6c 65 20 5f 56 | 46 69 78 65 64 3b 0d 09 |ouble _V|Fixed;..|
|00002200| 09 64 6f 75 62 6c 65 20 | 5f 4c 4f 66 66 73 65 74 |.double |_LOffset|
|00002210| 3b 0d 09 09 64 6f 75 62 | 6c 65 20 5f 74 6f 6c 65 |;...doub|le _tole|
|00002220| 72 61 6e 63 65 3b 0d 09 | 23 65 6e 64 69 66 0d 09 |rance;..|#endif..|
|00002230| 52 47 42 43 6f 6c 6f 72 | 20 72 67 62 3b 09 09 09 |RGBColor| rgb;...|
|00002240| 2f 2a 20 63 61 63 68 65 | 20 74 68 65 20 76 61 6c |/* cache| the val|
|00002250| 75 65 73 20 6f 66 20 74 | 68 65 20 66 69 78 65 64 |ues of t|he fixed|
|00002260| 20 44 41 43 73 20 2a 2f | 0d 09 6c 75 6d 69 6e 61 | DACs */|..lumina|
|00002270| 6e 63 65 54 61 62 6c 65 | 20 4c 3b 0d 7d 20 4c 75 |nceTable| L;.} Lu|
|00002280| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 3b 0d 0d |minanceR|ecord;..|
|00002290| 74 79 70 65 64 65 66 20 | 4c 75 6d 69 6e 61 6e 63 |typedef |Luminanc|
|000022a0| 65 52 65 63 6f 72 64 20 | 6c 75 6d 69 6e 61 6e 63 |eRecord |luminanc|
|000022b0| 65 52 65 63 6f 72 64 3b | 09 2f 2f 20 75 6e 63 61 |eRecord;|.// unca|
|000022c0| 70 69 74 61 6c 69 7a 65 | 20 62 65 66 6f 72 65 20 |pitalize| before |
|000022d0| 4f 63 74 6f 62 65 72 20 | 31 39 39 34 2e 0d 0d 65 |October |1994...e|
|000022e0| 6e 75 6d 20 7b 6c 75 6d | 69 6e 61 6e 63 65 53 65 |num {lum|inanceSe|
|000022f0| 74 3d 31 32 33 34 35 7d | 3b 09 2f 2a 20 61 20 75 |t=12345}|;./* a u|
|00002300| 6e 69 71 75 65 20 76 61 | 6c 75 65 20 74 68 61 74 |nique va|lue that|
|00002310| 20 77 65 20 63 61 6e 20 | 63 68 65 63 6b 20 66 6f | we can |check fo|
|00002320| 72 20 6c 61 74 65 72 20 | 2a 2f 0d 0d 2f 2a 20 4c |r later |*/../* L|
|00002330| 75 6d 69 6e 61 6e 63 65 | 2e 63 20 2a 2f 0d 64 6f |uminance|.c */.do|
|00002340| 75 62 6c 65 20 45 54 6f | 4c 28 4c 75 6d 69 6e 61 |uble ETo|L(Lumina|
|00002350| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 69 6e |nceRecor|d *LP,in|
|00002360| 74 20 65 6e 74 72 79 29 | 3b 0d 69 6e 74 20 4c 54 |t entry)|;.int LT|
|00002370| 6f 45 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |oE(Lumin|anceReco|
|00002380| 72 64 20 2a 4c 50 2c 64 | 6f 75 62 6c 65 20 4c 2c |rd *LP,d|ouble L,|
|00002390| 69 6e 74 20 66 69 72 73 | 74 45 6e 74 72 79 2c 69 |int firs|tEntry,i|
|000023a0| 6e 74 20 6c 61 73 74 45 | 6e 74 72 79 29 3b 0d 69 |nt lastE|ntry);.i|
|000023b0| 6e 74 20 4c 54 6f 45 4f | 72 64 65 72 65 64 28 4c |nt LToEO|rdered(L|
|000023c0| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|000023d0| 4c 50 2c 64 6f 75 62 6c | 65 20 4c 2c 69 6e 74 20 |LP,doubl|e L,int |
|000023e0| 66 69 72 73 74 45 6e 74 | 72 79 2c 69 6e 74 20 6c |firstEnt|ry,int l|
|000023f0| 61 73 74 45 6e 74 72 79 | 29 3b 0d 64 6f 75 62 6c |astEntry|);.doubl|
|00002400| 65 20 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 28 47 |e SetLum|inance(G|
|00002410| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 2c 4c |DHandle |device,L|
|00002420| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002430| 4c 50 0d 09 2c 69 6e 74 | 20 74 68 65 45 6e 74 72 |LP..,int| theEntr|
|00002440| 79 2c 64 6f 75 62 6c 65 | 20 6c 75 6d 69 6e 61 6e |y,double| luminan|
|00002450| 63 65 0d 09 2c 64 6f 75 | 62 6c 65 20 6c 6f 77 4c |ce..,dou|ble lowL|
|00002460| 75 6d 69 6e 61 6e 63 65 | 2c 64 6f 75 62 6c 65 20 |uminance|,double |
|00002470| 68 69 67 68 4c 75 6d 69 | 6e 61 6e 63 65 29 3b 0d |highLumi|nance);.|
|00002480| 64 6f 75 62 6c 65 20 53 | 65 74 4c 75 6d 69 6e 61 |double S|etLumina|
|00002490| 6e 63 65 73 28 47 44 48 | 61 6e 64 6c 65 20 64 65 |nces(GDH|andle de|
|000024a0| 76 69 63 65 2c 4c 75 6d | 69 6e 61 6e 63 65 52 65 |vice,Lum|inanceRe|
|000024b0| 63 6f 72 64 20 2a 4c 50 | 0d 09 2c 69 6e 74 20 66 |cord *LP|..,int f|
|000024c0| 69 72 73 74 45 6e 74 72 | 79 2c 69 6e 74 20 6c 61 |irstEntr|y,int la|
|000024d0| 73 74 45 6e 74 72 79 0d | 09 2c 64 6f 75 62 6c 65 |stEntry.|.,double|
|000024e0| 20 66 69 72 73 74 4c 75 | 6d 69 6e 61 6e 63 65 2c | firstLu|minance,|
|000024f0| 64 6f 75 62 6c 65 20 6c | 61 73 74 4c 75 6d 69 6e |double l|astLumin|
|00002500| 61 6e 63 65 29 3b 0d 64 | 6f 75 62 6c 65 20 53 65 |ance);.d|ouble Se|
|00002510| 74 4c 75 6d 69 6e 61 6e | 63 65 73 41 6e 64 52 61 |tLuminan|cesAndRa|
|00002520| 6e 67 65 28 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |nge(GDHa|ndle dev|
|00002530| 69 63 65 2c 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ice,Lumi|nanceRec|
|00002540| 6f 72 64 20 2a 4c 50 0d | 09 2c 69 6e 74 20 66 69 |ord *LP.|.,int fi|
|00002550| 72 73 74 45 6e 74 72 79 | 2c 69 6e 74 20 6c 61 73 |rstEntry|,int las|
|00002560| 74 45 6e 74 72 79 0d 09 | 2c 64 6f 75 62 6c 65 20 |tEntry..|,double |
|00002570| 66 69 72 73 74 4c 75 6d | 69 6e 61 6e 63 65 2c 64 |firstLum|inance,d|
|00002580| 6f 75 62 6c 65 20 6c 61 | 73 74 4c 75 6d 69 6e 61 |ouble la|stLumina|
|00002590| 6e 63 65 0d 09 2c 64 6f | 75 62 6c 65 20 6c 6f 77 |nce..,do|uble low|
|000025a0| 4c 75 6d 69 6e 61 6e 63 | 65 2c 64 6f 75 62 6c 65 |Luminanc|e,double|
|000025b0| 20 68 69 67 68 4c 75 6d | 69 6e 61 6e 63 65 29 3b | highLum|inance);|
|000025c0| 0d 76 6f 69 64 20 4c 6f | 61 64 4c 75 6d 69 6e 61 |.void Lo|adLumina|
|000025d0| 6e 63 65 73 28 47 44 48 | 61 6e 64 6c 65 20 64 65 |nces(GDH|andle de|
|000025e0| 76 69 63 65 2c 20 4c 75 | 6d 69 6e 61 6e 63 65 52 |vice, Lu|minanceR|
|000025f0| 65 63 6f 72 64 20 2a 4c | 50 2c 0d 09 69 6e 74 20 |ecord *L|P,..int |
|00002600| 66 69 72 73 74 45 6e 74 | 72 79 2c 20 69 6e 74 20 |firstEnt|ry, int |
|00002610| 6c 61 73 74 45 6e 74 72 | 79 29 3b 0d 76 6f 69 64 |lastEntr|y);.void|
|00002620| 20 49 6e 63 72 65 6d 65 | 6e 74 4c 75 6d 69 6e 61 | Increme|ntLumina|
|00002630| 6e 63 65 28 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |nce(GDHa|ndle dev|
|00002640| 69 63 65 2c 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ice,Lumi|nanceRec|
|00002650| 6f 72 64 20 2a 4c 50 2c | 69 6e 74 20 74 68 65 45 |ord *LP,|int theE|
|00002660| 6e 74 72 79 29 3b 0d 64 | 6f 75 62 6c 65 20 47 65 |ntry);.d|ouble Ge|
|00002670| 74 4c 75 6d 69 6e 61 6e | 63 65 28 47 44 48 61 6e |tLuminan|ce(GDHan|
|00002680| 64 6c 65 20 64 65 76 69 | 63 65 2c 4c 75 6d 69 6e |dle devi|ce,Lumin|
|00002690| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 2c 69 |anceReco|rd *LP,i|
|000026a0| 6e 74 20 74 68 65 45 6e | 74 72 79 29 3b 0d 64 6f |nt theEn|try);.do|
|000026b0| 75 62 6c 65 20 47 65 74 | 56 28 47 44 48 61 6e 64 |uble Get|V(GDHand|
|000026c0| 6c 65 20 64 65 76 69 63 | 65 2c 4c 75 6d 69 6e 61 |le devic|e,Lumina|
|000026d0| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 69 6e |nceRecor|d *LP,in|
|000026e0| 74 20 74 68 65 45 6e 74 | 72 79 29 3b 0d 64 6f 75 |t theEnt|ry);.dou|
|000026f0| 62 6c 65 20 56 54 6f 4c | 28 4c 75 6d 69 6e 61 6e |ble VToL|(Luminan|
|00002700| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 64 6f 75 |ceRecord| *LP,dou|
|00002710| 62 6c 65 20 56 29 3b 0d | 64 6f 75 62 6c 65 20 4c |ble V);.|double L|
|00002720| 54 6f 56 28 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ToV(Lumi|nanceRec|
|00002730| 6f 72 64 20 2a 4c 50 2c | 64 6f 75 62 6c 65 20 4c |ord *LP,|double L|
|00002740| 29 3b 0d 64 6f 75 62 6c | 65 20 4c 54 6f 56 46 6f |);.doubl|e LToVFo|
|00002750| 72 6d 75 6c 61 69 63 28 | 4c 75 6d 69 6e 61 6e 63 |rmulaic(|Luminanc|
|00002760| 65 52 65 63 6f 72 64 20 | 2a 4c 50 2c 64 6f 75 62 |eRecord |*LP,doub|
|00002770| 6c 65 20 4c 29 3b 0d 64 | 6f 75 62 6c 65 20 4c 54 |le L);.d|ouble LT|
|00002780| 6f 4c 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |oL(Lumin|anceReco|
|00002790| 72 64 20 2a 4c 50 2c 64 | 6f 75 62 6c 65 20 4c 29 |rd *LP,d|ouble L)|
|000027a0| 3b 0d 0d 2f 2a 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |;../* Th|e follow|
|000027b0| 69 6e 67 20 72 6f 75 74 | 69 6e 65 73 20 61 72 65 |ing rout|ines are|
|000027c0| 20 70 72 69 6d 61 72 69 | 6c 79 20 66 6f 72 20 69 | primari|ly for i|
|000027d0| 6e 74 65 72 6e 61 6c 20 | 75 73 65 2e 20 2a 2f 0d |nternal |use. */.|
|000027e0| 23 69 66 20 46 41 53 54 | 5f 4c 55 4d 49 4e 41 4e |#if FAST|_LUMINAN|
|000027f0| 43 45 0d 09 76 6f 69 64 | 20 5f 53 65 74 4c 75 6d |CE..void| _SetLum|
|00002800| 69 6e 61 6e 63 65 28 4c | 75 6d 69 6e 61 6e 63 65 |inance(L|uminance|
|00002810| 52 65 63 6f 72 64 20 2a | 4c 50 74 72 2c 69 6e 74 |Record *|LPtr,int|
|00002820| 20 74 68 65 45 6e 74 72 | 79 2c 46 69 78 65 64 20 | theEntr|y,Fixed |
|00002830| 5f 6c 75 6d 69 6e 61 6e | 63 65 29 3b 0d 09 46 69 |_luminan|ce);..Fi|
|00002840| 78 65 64 20 5f 54 6f 6c | 65 72 61 6e 63 65 28 4c |xed _Tol|erance(L|
|00002850| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002860| 4c 50 2c 46 69 78 65 64 | 20 5f 6c 75 6d 69 6e 61 |LP,Fixed| _lumina|
|00002870| 6e 63 65 29 3b 0d 09 76 | 6f 69 64 20 5f 53 65 74 |nce);..v|oid _Set|
|00002880| 4c 75 6d 69 6e 61 6e 63 | 65 73 28 4c 75 6d 69 6e |Luminanc|es(Lumin|
|00002890| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 2c 69 |anceReco|rd *LP,i|
|000028a0| 6e 74 20 66 69 72 73 74 | 2c 69 6e 74 20 6c 61 73 |nt first|,int las|
|000028b0| 74 0d 09 09 2c 46 69 78 | 65 64 20 5f 66 69 72 73 |t...,Fix|ed _firs|
|000028c0| 74 4c 2c 46 69 78 65 64 | 20 5f 64 4c 36 34 2c 46 |tL,Fixed| _dL64,F|
|000028d0| 69 78 65 64 20 5f 66 69 | 72 73 74 56 2c 46 69 78 |ixed _fi|rstV,Fix|
|000028e0| 65 64 20 5f 6c 61 73 74 | 56 29 3b 0d 09 46 69 78 |ed _last|V);..Fix|
|000028f0| 65 64 20 5f 56 54 6f 4c | 28 4c 75 6d 69 6e 61 6e |ed _VToL|(Luminan|
|00002900| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 46 69 78 |ceRecord| *LP,Fix|
|00002910| 65 64 20 5f 56 29 3b 0d | 09 46 69 78 65 64 20 5f |ed _V);.|.Fixed _|
|00002920| 4c 54 6f 56 28 4c 75 6d | 69 6e 61 6e 63 65 52 65 |LToV(Lum|inanceRe|
|00002930| 63 6f 72 64 20 2a 4c 50 | 2c 46 69 78 65 64 20 5f |cord *LP|,Fixed _|
|00002940| 4c 75 29 3b 0d 23 65 6c | 73 65 0d 09 76 6f 69 64 |Lu);.#el|se..void|
|00002950| 20 5f 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 28 4c | _SetLum|inance(L|
|00002960| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002970| 4c 50 74 72 2c 69 6e 74 | 20 74 68 65 45 6e 74 72 |LPtr,int| theEntr|
|00002980| 79 2c 64 6f 75 62 6c 65 | 20 5f 6c 75 6d 69 6e 61 |y,double| _lumina|
|00002990| 6e 63 65 29 3b 0d 09 64 | 6f 75 62 6c 65 20 5f 54 |nce);..d|ouble _T|
|000029a0| 6f 6c 65 72 61 6e 63 65 | 28 4c 75 6d 69 6e 61 6e |olerance|(Luminan|
|000029b0| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 64 6f 75 |ceRecord| *LP,dou|
|000029c0| 62 6c 65 20 5f 6c 75 6d | 69 6e 61 6e 63 65 29 3b |ble _lum|inance);|
|000029d0| 0d 09 76 6f 69 64 20 5f | 53 65 74 4c 75 6d 69 6e |..void _|SetLumin|
|000029e0| 61 6e 63 65 73 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |ances(Lu|minanceR|
|000029f0| 65 63 6f 72 64 20 2a 4c | 50 2c 69 6e 74 20 66 69 |ecord *L|P,int fi|
|00002a00| 72 73 74 2c 69 6e 74 20 | 6c 61 73 74 0d 09 09 2c |rst,int |last...,|
|00002a10| 64 6f 75 62 6c 65 20 5f | 66 69 72 73 74 4c 2c 64 |double _|firstL,d|
|00002a20| 6f 75 62 6c 65 20 5f 64 | 4c 38 2c 64 6f 75 62 6c |ouble _d|L8,doubl|
|00002a30| 65 20 5f 66 69 72 73 74 | 56 2c 64 6f 75 62 6c 65 |e _first|V,double|
|00002a40| 20 5f 6c 61 73 74 56 29 | 3b 0d 09 64 6f 75 62 6c | _lastV)|;..doubl|
|00002a50| 65 20 5f 56 54 6f 4c 28 | 4c 75 6d 69 6e 61 6e 63 |e _VToL(|Luminanc|
|00002a60| 65 52 65 63 6f 72 64 20 | 2a 4c 50 2c 64 6f 75 62 |eRecord |*LP,doub|
|00002a70| 6c 65 20 5f 56 29 3b 0d | 09 64 6f 75 62 6c 65 20 |le _V);.|.double |
|00002a80| 5f 4c 54 6f 56 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |_LToV(Lu|minanceR|
|00002a90| 65 63 6f 72 64 20 2a 4c | 50 2c 64 6f 75 62 6c 65 |ecord *L|P,double|
|00002aa0| 20 5f 4c 75 29 3b 0d 23 | 65 6e 64 69 66 0d 64 6f | _Lu);.#|endif.do|
|00002ab0| 75 62 6c 65 20 53 65 74 | 4c 75 6d 69 6e 61 6e 63 |uble Set|Luminanc|
|00002ac0| 65 52 61 6e 67 65 28 4c | 75 6d 69 6e 61 6e 63 65 |eRange(L|uminance|
|00002ad0| 52 65 63 6f 72 64 20 2a | 4c 50 0d 09 2c 64 6f 75 |Record *|LP..,dou|
|00002ae0| 62 6c 65 20 6c 6f 77 4c | 75 6d 69 6e 61 6e 63 65 |ble lowL|uminance|
|00002af0| 2c 64 6f 75 62 6c 65 20 | 68 69 67 68 4c 75 6d 69 |,double |highLumi|
|00002b00| 6e 61 6e 63 65 29 3b 0d | 64 6f 75 62 6c 65 20 56 |nance);.|double V|
|00002b10| 54 6f 4c 50 6f 77 65 72 | 28 4c 75 6d 69 6e 61 6e |ToLPower|(Luminan|
|00002b20| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 64 6f 75 |ceRecord| *LP,dou|
|00002b30| 62 6c 65 20 56 29 3b 09 | 09 09 2f 2a 20 75 73 65 |ble V);.|../* use|
|00002b40| 20 56 54 6f 4c 28 29 20 | 69 6e 73 74 65 61 64 20 | VToL() |instead |
|00002b50| 2a 2f 0d 64 6f 75 62 6c | 65 20 56 54 6f 4c 50 6f |*/.doubl|e VToLPo|
|00002b60| 6c 79 6e 6f 6d 69 61 6c | 28 4c 75 6d 69 6e 61 6e |lynomial|(Luminan|
|00002b70| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 64 6f 75 |ceRecord| *LP,dou|
|00002b80| 62 6c 65 20 56 29 3b 09 | 2f 2a 20 75 73 65 20 56 |ble V);.|/* use V|
|00002b90| 54 6f 4c 28 29 20 69 6e | 73 74 65 61 64 20 2a 2f |ToL() in|stead */|
|00002ba0| 0d 64 6f 75 62 6c 65 20 | 4c 54 6f 56 50 6f 77 65 |.double |LToVPowe|
|00002bb0| 72 28 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |r(Lumina|nceRecor|
|00002bc0| 64 20 2a 4c 50 2c 64 6f | 75 62 6c 65 20 4c 29 3b |d *LP,do|uble L);|
|00002bd0| 09 09 09 2f 2a 20 75 73 | 65 20 4c 54 6f 56 28 29 |.../* us|e LToV()|
|00002be0| 20 69 6e 73 74 65 61 64 | 20 2a 2f 0d 64 6f 75 62 | instead| */.doub|
|00002bf0| 6c 65 20 4c 54 6f 56 50 | 6f 6c 79 6e 6f 6d 69 61 |le LToVP|olynomia|
|00002c00| 6c 28 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |l(Lumina|nceRecor|
|00002c10| 64 20 2a 4c 50 2c 64 6f | 75 62 6c 65 20 4c 29 3b |d *LP,do|uble L);|
|00002c20| 09 2f 2a 20 75 73 65 20 | 4c 54 6f 56 28 29 20 69 |./* use |LToV() i|
|00002c30| 6e 73 74 65 61 64 20 2a | 2f 0d 64 6f 75 62 6c 65 |nstead *|/.double|
|00002c40| 20 4c 54 6f 56 51 75 61 | 64 72 61 74 69 63 28 4c | LToVQua|dratic(L|
|00002c50| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002c60| 4c 50 2c 64 6f 75 62 6c | 65 20 4c 29 3b 09 09 2f |LP,doubl|e L);../|
|00002c70| 2a 20 75 73 65 20 4c 54 | 6f 56 28 29 20 69 6e 73 |* use LT|oV() ins|
|00002c80| 74 65 61 64 20 2a 2f 0d | 0d 2f 2a 20 52 65 61 64 |tead */.|./* Read|
|00002c90| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 2e |Luminanc|eRecord.|
|00002ca0| 63 20 2a 2f 0d 0d 6c 6f | 6e 67 20 52 65 61 64 4c |c */..lo|ng ReadL|
|00002cb0| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 28 63 |uminance|Record(c|
|00002cc0| 68 61 72 20 2a 66 69 6c | 65 6e 61 6d 65 2c 4c 75 |har *fil|ename,Lu|
|00002cd0| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 20 2a 4c |minanceR|ecord *L|
|00002ce0| 50 2c 73 68 6f 72 74 20 | 66 6c 61 67 73 29 3b 0d |P,short |flags);.|
|00002cf0| 6c 6f 6e 67 20 57 72 69 | 74 65 4c 75 6d 69 6e 61 |long Wri|teLumina|
|00002d00| 6e 63 65 52 65 63 6f 72 | 64 28 63 68 61 72 20 2a |nceRecor|d(char *|
|00002d10| 66 69 6c 65 6e 61 6d 65 | 2c 4c 75 6d 69 6e 61 6e |filename|,Luminan|
|00002d20| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 73 68 6f |ceRecord| *LP,sho|
|00002d30| 72 74 20 66 6c 61 67 73 | 29 3b 0d 44 65 73 63 72 |rt flags|);.Descr|
|00002d40| 69 70 74 69 6f 6e 20 2a | 44 65 73 63 72 69 62 65 |iption *|Describe|
|00002d50| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 28 |Luminanc|eRecord(|
|00002d60| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|00002d70| 2a 4c 50 29 3b 0d 0d 23 | 65 6e 64 69 66 20 5f 4c |*LP);..#|endif _L|
|00002d80| 55 4d 49 4e 41 4e 43 45 | 5f 0d 0d 00 00 00 00 00 |UMINANCE|_.......|
|00002d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e00| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00002e10| 00 00 00 1c 0a 22 00 03 | 43 4f 44 45 00 1a 00 22 |....."..|CODE..."|
|00002e20| 53 54 52 20 00 b5 01 66 | 63 6d 64 6f 00 00 09 ee |STR ...f|cmdo....|
|00002e30| 0b 4c 75 6d 69 6e 61 6e | 63 65 2e 68 02 00 00 00 |.Luminan|ce.h....|
|00002e40| 50 61 72 74 53 49 54 21 | 00 00 00 00 00 00 00 00 |PartSIT!|........|
|00002e50| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e70| 00 00 ab bf ee 64 00 00 | 00 00 00 00 01 ac 00 00 |.....d..|........|
|00002e80| 00 06 00 22 20 01 63 50 | 00 00 00 00 00 07 00 27 |..." .cP|.......'|
|00002e90| 20 01 b3 10 00 00 00 00 | 00 08 00 2f 20 01 c8 10 | .......|.../ ...|
|00002ea0| 00 00 00 00 00 09 00 35 | 20 02 15 dc 00 00 00 00 |.......5| .......|
|00002eb0| 00 0a 00 3b 20 02 47 b4 | 00 00 00 00 00 0b 00 40 |...; .G.|.......@|
|00002ec0| 20 02 98 26 00 00 00 00 | 00 0c 00 49 20 02 e7 66 | ..&....|...I ..f|
|00002ed0| 00 00 00 00 00 0d 00 4e | 20 03 62 92 00 00 00 00 |.......N| .b.....|
|00002ee0| 00 0e 00 57 20 03 dd 0a | 00 00 00 00 00 0f 00 5c |...W ...|.......\|
|00002ef0| 20 04 18 02 00 00 00 00 | 00 10 00 61 20 04 4c e0 | .......|...a .L.|
|00002f00| 00 00 00 1e 00 2a 00 03 | 01 d1 01 ff 00 2a 00 03 |.....*..|.....*..|
|00002f10| 01 6b 01 3a 00 00 00 00 | 00 00 00 00 00 00 00 00 |.k.:....|........|
|00002f20| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00002f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f40| 00 00 00 00 00 00 00 00 | 00 03 00 04 00 48 00 19 |........|.....H..|
|00002f50| 01 8e 02 83 00 48 00 19 | 01 8e 02 83 aa c8 36 37 |.....H..|......67|
|00002f60| 00 00 0b b3 00 00 0b b3 | 00 00 06 f3 00 00 00 00 |........|........|
|00002f70| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 cf |.....n..|.n...>..|
|00002f80| ce a4 1a d0 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |........|.>..MPSR|
|00002f90| 00 01 00 0a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00002fa0| 03 ed ff ff 00 00 00 22 | 00 00 00 00 00 00 00 00 |......."|........|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+